package com.example.fashionshoes.service.coupon;

import com.example.fashionshoes.exception.BusinessException;
import com.example.fashionshoes.pojo.po.Coupon;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class CouponContext {

    private CouponStrategy couponStrategy;
    public BigDecimal execute(BigDecimal price, Coupon coupon) throws BusinessException {
        return couponStrategy.useCoupon(price, coupon);
    }
}
